package whf.survey.entity;

/**
 * @author wanghaifeng
 * @create Sep 12, 2006 10:17:14 PM
 * 
 */
public class SurveyTopicChoice extends whf.framework.entity.AbstractEntity {

	private static final long serialVersionUID = 0;

	private whf.survey.entity.SurveyTopic topic;
	
	private int sortOrder;

	// ---------- methods ----------

	public void setTopic(whf.survey.entity.SurveyTopic topic) {
		this.topic = topic;
	}

	public whf.survey.entity.SurveyTopic getTopic() {
		return this.topic;
	}

	/**
	 * @return Returns the sortOrder.
	 */
	public final int getSortOrder() {
		return sortOrder;
	}

	/**
	 * @param sortOrder The sortOrder to set.
	 */
	public final void setSortOrder(int sortOrder) {
		this.sortOrder = sortOrder;
	}

	/* (non-Javadoc)
	 * @see whf.framework.entity.AbstractEntity#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(Object obj) {
		return this.sortOrder - ((SurveyTopicChoice)obj).getSortOrder();
	}

}